<div class="row-fluid">
    <div class="span12">
        <div class="grid simple">
			<div class="grid-body no-border email-body">
				<?php
				/* @var $this BlocksController */
				/* @var $model Blocks */


				$this->breadcrumbs = array(
					'Blocks' => array('index'),
					'Управление',
				);
				?>
				<?php
				$form = $this->beginWidget('CActiveForm', array(
					'enableAjaxValidation' => true,
				));
				?>
				<br />
				<?php
				$this->widget('bootstrap.widgets.TbGridView', array(
					'id' => 'blocks-grid',
					'dataProvider' => $model->search(),
					'filter' => $model,
					'htmlOptions' => array(
						'class' => 'table-bordered table-hover',
					),
					'columns' => array(
						array(
							'id' => 'blockId',
							'class' => 'CCheckBoxColumn',
							'selectableRows' => '50',
						),
						array(
							'name' => 'blockWidget',
							'filter' => BlocksController::$widgetList,
							//'value' => 'BlocksController::$widgetList[$data->blockWidget]'
						),
						array('name' => 'blockAction',
							//'value' => 'empty($data->blockUrl) ? BlocksController::$actionsList[$data->blockAction] : $data->blockUrl;'
							),
						array('name' => 'blockPosition',
							'filter' => BlocksController::$posList,
							//'value' => 'BlocksController::$posList[$data->blockPosition]'
							),
						//'blockPosition',
						array(
							'name' => 'blockOrder',
							'filter' => '',
						),
						array(
							'name' => 'blockActive',
							'header' => 'Статус',
							'filter' => array('1' => 'Активна', '0' => 'Отключена'),
							'value' => '($data->blockActive=="1")?("Активна"):("Отключена")'
						),
						//'blockActive',
						/*
						  'blockContent',
						  'blockActive',
						 */
						array(
							'class' => 'bootstrap.widgets.TbButtonColumn',
						),
					),
				));
				?>
				<script>
					function reloadGrid(data) {
						$.fn.yiiGridView.update('blocks-grid');
					}
				</script>
				<br />
				<div>
					<?php echo CHtml::ajaxSubmitButton('Включить', array('blocks/ajaxupdate', 'act' => 'doActive'), array('success' => 'reloadGrid'), array('class' => 'btn btn-success btn-large', 'id' => 'button_left3')); ?>

					<?php echo CHtml::ajaxSubmitButton('Отключить', array('blocks/ajaxupdate', 'act' => 'doInactive'), array('success' => 'reloadGrid'), array('class' => 'btn btn-danger btn-large', 'id' => 'button_left')); ?>
				</div>
				<?php $this->endWidget(); ?>
			</div>
        </div>	
    </div>
</div>